package com.spooky.esb.bean.parser;

import org.springframework.beans.factory.support.BeanDefinitionBuilder;
import org.springframework.beans.factory.xml.AbstractSingleBeanDefinitionParser;
import org.w3c.dom.Element;
import com.spooky.esb.entity.Flow;

public class FlowBeanDefinitionParser extends AbstractSingleBeanDefinitionParser {
	@Override
	protected Class getBeanClass(Element element) {
		return Flow.class;
	}

	@Override
	protected void doParse(Element element, BeanDefinitionBuilder bean) {
		String pattern = element.getAttribute("name");
		bean.addConstructorArgValue(pattern);
	}
}
